<?php
class DumpAnnouncePage extends TPage
{	
	
	function OnInit($param)
	{
		parent::onInit($param);
		
		include("config.php");
		
		$repositoryid = $_GET['RepositoryID'];
		
		$results = $this->Module->Database->Execute("SELECT * FROM repositories WHERE id='$repositoryid'");
		$fields = $results->fields;
		$ownerid = $fields['ownerid'];
		$name = $fields['name'];
		
		if(!$this->User->isAdmin() && $this->User->getId()!=$ownerid)
		{
			echo "Not enough rights to change this repository!";
			exit(-1);
		}

		$servername =$_SERVER['SERVER_NAME'];
		$page = $_SERVER['PHP_SELF'];				
		$url = "https://$servername$page?page=Repository:DumpOutputPage&RepositoryID=$repositoryid"; 
		
		$this->StartLink->setNavigateUrl("$url");
		header("Refresh: 3; URL=$url");		
				
	}
	
	public function OnGoBack($sender, $param)
	{
		$this->Application->transfer("Repository:AdminPage");
	}
	
}

?>